#pragma once
#include "MovingLocationShader.h"
#include "glm/ext/vector_float3.hpp"

class MovingCameraByKeybord : public MovingLocationShader
{
  public:
    MovingCameraByKeybord(const string& vertexShaderSource,
                          const string& fragmentShaderSource,
                          GLFWwindow* window);

    mat4 createViewMatrix() override;

  private:
    static void mouse_callback(GLFWwindow* window, double xpos, double ypos);
    void mouseMoved(double xpos, double ypos);  
    GLFWwindow* window;
    vec3 cameraPosition;
    vec3 cameraFront;
    vec3 cameraUp;
    double lastMouseXPos = 0;
    double lastMouseYPos = 0;
    // 偏航角
    float yaw;
    // 俯仰角
    float pitch;
    // 上一帧的渲染时间
    float lastRenderTime;
    bool isFirstMouseCallback = true;
};